﻿//JumbotCms_4.1 Final
using System;
using System.Data;
using System.Web;
using System.IO;
using JumbotCms.Common;
namespace JumbotCms.WebFile.Admin
{
    public partial class _user_api : JumbotCms.API.AdminCenter
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Admin_Load("0000", "html");
            if (!Page.IsPostBack)
            {
                string strXmlFile = HttpContext.Current.Server.MapPath("~/_data/config/api.config");
                Jumbot.DataOper.XmlControl XmlTool = new Jumbot.DataOper.XmlControl(strXmlFile);
                this.txtForumPath.Text = XmlTool.GetText("Root/ForumPath");
                this.txtForumUrl.Text = XmlTool.GetText("Root/ForumUrl");
                this.txtLoginUrl.Text = XmlTool.GetText("Root/LoginUrl");
                this.txtLogoutUrl.Text = XmlTool.GetText("Root/LogoutUrl");
                this.txtRegisterUrl.Text = XmlTool.GetText("Root/RegisterUrl");
                XmlTool.Dispose();
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            string strXmlFile = HttpContext.Current.Server.MapPath("~/_data/config/api.config");
            Jumbot.DataOper.XmlControl XmlTool = new Jumbot.DataOper.XmlControl(strXmlFile);
            XmlTool.Update("Root/ForumPath", this.txtForumPath.Text);
            XmlTool.Update("Root/ForumUrl", this.txtForumUrl.Text);
            XmlTool.Update("Root/LoginUrl", this.txtLoginUrl.Text);
            XmlTool.Update("Root/LogoutUrl", this.txtLogoutUrl.Text);
            XmlTool.Update("Root/RegisterUrl", this.txtRegisterUrl.Text);
            XmlTool.Save();
            XmlTool.Dispose();
            SetupSystemDate();
            new CreateJson().CreateSystemInfo(doh);
            FinalMessage("保存成功!", "api.aspx", 0);
        }
    }
}
